import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import RankingView from '../views/RankingView.vue'
import ClassifyView from '../views/ClassifyView.vue'
import ComicDetailView from '../views/ComicDetailView.vue'
import MangaView from '../views/MangaView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    meta: {
      istrun: true
    },
  },
  {
    path: '/comic_id=:id',
    name: 'ComicDetailView',
    props: true,
    component: ComicDetailView
  },
  {
    path: '/ranking',
    name: 'ranking',
    component: RankingView,
    meta: {
      istrun: true
    },
  },
  {
    path: '/classify',
    name: 'classify',
    component: ClassifyView,
    meta: {
      istrun: true
    },
  },
  {
    path: '/manga/:id/:code',
    name: 'manga',
    component: MangaView,
    props: true
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
